package com.bookstore.service.impl;

import com.bookstore.domain.Book;
import com.bookstore.domain.User;
import com.bookstore.mapper.BookMapper;
import com.bookstore.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookMapper mapper;
    @Override
    public List<Book> findAll(Integer btype, String bname) {
        return mapper.findAll(btype,bname);
    }

    @Override
    public Integer save(Book book) {
        return mapper.saveBook(book);
    }

    @Override
    public List<Book> findByUtype(Integer utype,Integer btype,String bname) {
        return mapper.findByUtype(utype,btype,bname);
    }

    @Override
    public Book findByBid(Integer bid) {
        return mapper.findById(bid);
    }

    @Override
    public int updateBook(Book book) {
        return mapper.updateBook(book);
    }

    @Override
    public int delByBid(Integer bid) {
        return mapper.deleteByBid(bid);
    }
}
